<!DOCTYPE html>
<!-- saved from url=(0045)https://uniapp.dcloud.io/static/web-view.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
		<title>pm_h5</title>
		<style type="text/css">
			.btn {
				display: block;
				margin: 20px auto;
				padding: 5px;
				background-color: #007aff;
				border: 0;
				color: #ffffff;
				height: 40px;
				width: 200px;
			}

			.btn-red {
				background-color: #dd524d;
			}

			.btn-yellow {
				background-color: #f0ad4e;
			}

			.desc {
				padding: 10px;
				color: #999999;
			}

			.post-message-section {
				visibility: hidden;
			}
		</style>
	</head>
	<body>
		
		<div class="post-message-section" style="visibility: visible;">
			<div class="btn-list">
				<button class="btn btn-red" type="button" id="postMessage2">预览pdf</button>
			</div>
			<div class="btn-list">
				<button class="btn btn-red" type="button" id="postMessage3">预览pdf3</button>
			</div>
			<div class="btn-list">
				<button class="btn " type="button" id="postMessage4">小程序授权</button>
			</div>
			
			<div class="btn-list">
				<button class="btn " type="button" id="postMessage5">跳转#</button>
			</div>
			
			<div class="btn-list">
				<button class="btn " type="button" id="postMessage6">扫码</button>
			</div>
		
			<div class="btn-list">
				<a href="https://static-b355b199-f26f-4bea-b13c-1b2c8fff663f.bspapp.com/testpdf.pdf">预览pdf</a>
			</div>
			
			<div class="btn-list">
				<button class="btn " type="button" id="postMessage8">改标题</button>
			</div>
		</div>
		<script type="text/javascript">
			// var userAgent = navigator.userAgent;
			// // alert(/miniProgram/i.test(userAgent) && /micromessenger/i.test(userAgent))
			// if  (/miniProgram/i.test(userAgent) && /micromessenger/i.test(userAgent)) {
			// 	// 微信小程序 JS-SDK 如果不需要兼容微信小程序，则无需引用此 JS 文件。
			// 	document.write('<script type="text/javascript" src="./jweixin-1.3.2.js"><\/script>');
			// } 
			
		</script>
		<script type="text/javascript" src="./jweixin-1.3.2.js"></script>
		<!-- uni 的 SDK -->
		<script type="text/javascript" src="./index.js"></script>
		<script type="text/javascript">
			document.addEventListener('UniAppJSBridgeReady', function() {
				
				
				
				
				document.getElementById('postMessage2').addEventListener('click', function() {
					
					uni.postMessage({
						data: {
							action: 'pdf'
						}
					});
					uni.navigateBack({
						delta: 1
					});
					
								 	
				});
				
				document.getElementById('postMessage3').addEventListener('click', function() {
					
					
					// wx.miniProgram.postMessage({
					// data: {
					// 	action: 'pdf'
					// }
				 //  })
				 //  wx.miniProgram.switchTab({
					// url: '/pages/samplepage/demo' // 小程序中页面的路径
				 //  })
				 
					wx.miniProgram.navigateTo({
						url: '/pages/result?action=pdf' // 小程序中页面的路径
					 })	
					 
					 //  wx.miniProgram.navigateTo({
						// url: '/pages/webview/result' // 小程序中页面的路径
					 // })	
									
				});
				
				
				document.getElementById('postMessage4').addEventListener('click', function() {
					wx.miniProgram.navigateTo({
						url: '/pages/result?action=login' // 小程序中页面的路径
					 })	
				});
				
				document.getElementById('postMessage5').addEventListener('click', function() {
					location.href+="#/abc"
					console.log('location.href ',location.href)
					wx.miniProgram.navigateTo({
						url: '/pages/result?action=href' // 小程序中页面的路径
					 })	
				});
				
				document.getElementById('postMessage6').addEventListener('click', function() {
					
					wx.miniProgram.navigateTo({
						url: '/pages/result?action=signScan&workOrderId=wod' // 小程序中页面的路径
					 })	
				});
				
				document.getElementById('postMessage8').addEventListener('click', function() {
					
					document.title = "改变的标题"
					location.href =location.href+"?#sdf"
				});
				
			});
			
			function login(){
				wx.miniProgram.redirectTo({
					url: '/pages/webview/result?action=login' // 小程序中页面的路径
				 })	
			}
		</script>
	

</body></html>